package com.nenglai.admin.modular.system.formatter;

import com.kordar.datalist.formatter.Formatter;
import com.nenglai.admin.modular.system.enums.AdminStatus;
import com.nenglai.admin.modular.system.enums.AdminType;
import com.nenglai.common.enums.EnumUtils;

public class AdminEnumFormatter implements Formatter<String> {
    @Override
    public String format(Object value, Object... params) {
        Integer key = (Integer) value;
        String t = (String) params[0];
        switch (t) {
            case "type":
                return EnumUtils.ValueByCode(AdminType.class, key);
            case "status":
                return EnumUtils.ValueByCode(AdminStatus.class, key);
            default:
                return "";
        }
    }
}
